CPP=g++
CC = gcc
MAKE=make

NAME = vview
CPP_FILES = src/viewer.cpp src/main.cpp

CPP_OBJECTS	= $(CPP_FILES:src/%.cpp=%.o)

COMPILE_FLAGS =  -I../../../libpland/lib/ -I../../../tinyxml/ -I../../../libkport2/lib/ -I../../../libpipc/lib/ -O2
LINK_FLAGS =  -o $(NAME) -lboost_thread -L../../../build/ -ltinyxml -lpland -lkport2 -lpthread -fPIC -Wl,--rpath,. -rdynamic -ldl -lpipc -lboost_filesystem -lboost_system $(shell pkg-config --libs opencv)

all: bin

system: bin

%.o: src/%.cpp
	$(CPP) $(COMPILE_FLAGS) -c -o $@  $< 

%.o: src/%.c
	$(CC) $(COMPILE_FLAGS) -c -o $@  $<

bin: $(CPP_OBJECTS) $(C_OBJECTS)
	$(CPP) $(CPP_OBJECTS) $(C_OBJECTS) -o $(NAME) $(LINK_FLAGS)

.PHONY	: clean open

clean:
	rm -rf *.o $(NAME) log.txt
open:
	geany  src/*.cpp lib/*.hpp &
